import { createRouter, createWebHistory } from 'vue-router'
import indexVue from '../views/index.vue'

const NotFoundPage = {
  template: '<h3>对不起，宁访问的资源:{{ $route.params.pathMatch.join("/") }}不存在！</h3>'
}

const routes = [
  {
    path: '/index/:qq?',
    name: 'index',
    component: indexVue
  },
  {
    path: '/',
    redirect: '/index', //  重定向到 /index
  },
  {
    path: '/dl',
    name: 'dl',
    component: () => import('../views/dl.vue'),
  },
  {
    path: '/zc',
    name: 'zc',
    component: () => import('../views/zc.vue'),
  },
  {
    path: '/spxx/:id?/:qq?',
    name: 'spxx',
    component: () => import('../views/spxx.vue'),
  },
  {
    path: '/gwc/:qq?',
    name: 'gwc',
    component: () => import('../views/gwc.vue'),
  },
  {
    path: '/dingdan/:qq?',
    name: 'dingdan',
    component: () => import('../views/dingdan.vue'),
  },
  {
    path: '/dingdan2/:qq?',
    name: 'dingdan2',
    component: () => import('../views/dingdan2.vue'),
  },
  {
    path: '/Lex/:qq?',
    name: 'Lex',
    component: () => import('../views/Lex.vue'),
  },
  {
    path: '/:pathMatch(.*)*',
    name: '404',
    component:() => import('../views/404.vue'),
  },
]

const route = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default route
